<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="themes/default/layout/public">

<head>
    <title th:text="|绑定邮箱 - ${GlobalSetting.website.name}|"></title>

</head>
<div  layout:fragment="content">
    <div class="row">
        <!--左侧菜单-->
        <div th:replace="themes/default/layout/profile_menu"></div>

        <div id="main" class="settings col-md-10 form-horizontal">
            <h2 class="h3 post-title">修改邮箱</h2>

            <div th:if="${user.data.emailVerified}" class="alert alert-success" role="alert">
                您的邮箱已绑定，如需修改，请按照下方提示进行操作！
            </div>
            <div th:if="${user.data.emailVerified==null || !user.data.emailVerified}" class="alert alert-warning" role="alert">
                您还未进行邮箱绑定，绑定后可通过邮箱地址登录系统.
            </div>

            <div class="row mt-30">
                <div class="col-md-8">
                    <form name="baseForm" id="base_form" th:action="${#request.getRequestURI()}" method="POST">
                        <div class="form-group" th:classappend="${error.fields['email']!=null}?'has-error'">
                            <label for="email" class="required control-label col-sm-3">邮箱地址</label>
                            <div class="col-sm-9">
                                <input name="email" id="email" type="text" maxlength="64"  class="form-control" th:value="${user.email}" />
                                <span  th:if="${error.fields['email']!=null}" th:text="${error.fields['email']}" class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group" th:classappend="${error?.fields['imageCode']!=null}?'has-error'">
                            <label class="required control-label col-sm-3">验证码</label>
                            <div class="col-sm-4">
                                <input name="imageCode" type="text" maxlength="32" placeholder="请输入下方验证码" class="form-control" th:value="${imageCode}" />
                                <span class="help-block" th:if="${error?.fields['imageCode']!=null}" th:utext="${error?.fields['imageCode']}"></span>
                                <div class="mt-10"><a href="javascript:void(0);" id="reloadCaptcha"><img th:src="${GlobalSetting.irrigation.codeUrl}"></a></div>
                            </div>
                        </div>
                        <div class="form-action row">
                            <div class="col-sm-offset-3 col-sm-9">
                                <button class="btn btn-xl btn-primary" type="submit">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>